package or.exa.cangguan.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import or.exa.cangguan.common.Page;
import or.exa.cangguan.common.Result;
import or.exa.cangguan.entity.vo.GoodsPlaceVo;
import or.exa.cangguan.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "库存管理")
@Slf4j
@RestController
public class StockController {
    @Autowired
    private StockService stockService;


    @ApiOperation(value = "查询库存")
    @PostMapping("/stock/stock-list")
    public Result getStockList(@RequestBody GoodsPlaceVo goodsPlaceVo) {
        log.info("查询库存");
        log.info(goodsPlaceVo.toString());
        Page page = stockService.getStockList(goodsPlaceVo);
        return Result.ok(page);

    }




}
